// 导入 
import BaseAPI from './baseapi'
import request from '../utils/request';


// 继承类
class RolesApi extends BaseAPI{

    constructor(appname:string, name: string) {
       super(appname, name);
    }

    // 当前类定义的函数 
    public assign = (id:any,data:any) => {
        return request({
            method: 'post',
            url: `${this.appname}/${this.name}/${id}/assign/`,
            data
        })
    }

    // 获取当前角色的权限 
    public listPermissions = (id:any) => {
        return request({
            method: 'post',
            url: `${this.appname}/${this.name}/${id}/list/permissions/`,
        })
    }

}
export default RolesApi